package com.talos.ums.dal.mysql.useracounttype;

import com.talos.framework.common.pojo.PageResult;
import com.talos.framework.mybatis.core.mapper.BaseMapperX;
import com.talos.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.talos.ums.controller.admin.useracounttype.vo.UmsUserAcountTypePageReqVO;
import com.talos.ums.dal.dataobject.useracounttype.UmsUserAcountTypeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 账号类型 Mapper
 *
 * @author ${table.author}
 */
@Mapper
public interface UmsUserAcountTypeMapper extends BaseMapperX<UmsUserAcountTypeDO> {

    default PageResult<UmsUserAcountTypeDO> selectPage(UmsUserAcountTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UmsUserAcountTypeDO>()
                .eqIfPresent(UmsUserAcountTypeDO::getUserId, reqVO.getUserId())
                .eqIfPresent(UmsUserAcountTypeDO::getAcountType, reqVO.getAcountType())
                .eqIfPresent(UmsUserAcountTypeDO::getAcountTypeDesc, reqVO.getAcountTypeDesc())
                .eqIfPresent(UmsUserAcountTypeDO::getTenantId, reqVO.getTenantId())
                .eqIfPresent(UmsUserAcountTypeDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(UmsUserAcountTypeDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(UmsUserAcountTypeDO::getCreatorId, reqVO.getCreatorId())
                .eqIfPresent(UmsUserAcountTypeDO::getCreatorCode, reqVO.getCreatorCode())
                .likeIfPresent(UmsUserAcountTypeDO::getCreatorName, reqVO.getCreatorName())
                .betweenIfPresent(UmsUserAcountTypeDO::getModifyTime, reqVO.getModifyTime())
                .eqIfPresent(UmsUserAcountTypeDO::getModifierId, reqVO.getModifierId())
                .eqIfPresent(UmsUserAcountTypeDO::getModifierCode, reqVO.getModifierCode())
                .likeIfPresent(UmsUserAcountTypeDO::getModifierName, reqVO.getModifierName())
                .orderByDesc(UmsUserAcountTypeDO::getId));
    }

}
